home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1995 July
/
64er_Magazin_95-07_1995_Markt__Technik_de_Side_A.d64
/
listing 04
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
354b
|
19 lines
1000 rem string-zahl-w. mit nachkomma
1010 t$="12.34":z=0:a=0.1:k$="."
1020 rem komma suchen
1030 for i=1tolen(t$)
1040 ifk$<>left$(right$(t$,i),1)thennexti
1050 k=i
1060 rem nachkommastelle berechnen
1070 for i=1tok-1
1080 t=asc(left$(right$(t$,i),1))-48
1090 z=z+t*a:a=a/10
1100 nexti
1110 rem vorkommatelle berechnen
1120 a=1
1130 for i=k+1 to len(t$)
1140 t=asc(left$(right$(t$,i),1))-48
1150 z=z+t*a:a=a*10
1160 next i
1170 print z